import 'package:xin_nuo_pda/bean/edc_data_entity.dart';

edcDataEntityFromJson(EdcDataEntity data, Map<String, dynamic> json) {
	if (json['LOTID'] != null) {
		data.lOTID = json['LOTID'].toString();
	}
	if (json['MAINQTY'] != null) {
		data.mAINQTY = json['MAINQTY'] is String
				? int.tryParse(json['MAINQTY'])
				: json['MAINQTY'].toInt();
	}
	if (json['PARTNAME'] != null) {
		data.pARTNAME = json['PARTNAME'].toString();
	}
	if (json['STEPNAME'] != null) {
		data.sTEPNAME = json['STEPNAME'].toString();
	}
	if (json['EDCSETLIST'] != null) {
		data.eDCSETLIST = (json['EDCSETLIST'] as List).map((v) => EdcDataEDCSETLIST().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> edcDataEntityToJson(EdcDataEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['LOTID'] = entity.lOTID;
	data['MAINQTY'] = entity.mAINQTY;
	data['PARTNAME'] = entity.pARTNAME;
	data['STEPNAME'] = entity.sTEPNAME;
	data['EDCSETLIST'] =  entity.eDCSETLIST?.map((v) => v.toJson())?.toList();
	return data;
}

edcDataEDCSETLISTFromJson(EdcDataEDCSETLIST data, Map<String, dynamic> json) {
	if (json['EDCCURRENTRRN'] != null) {
		data.eDCCURRENTRRN = json['EDCCURRENTRRN'] is String
				? int.tryParse(json['EDCCURRENTRRN'])
				: json['EDCCURRENTRRN'].toInt();
	}
	if (json['LOTRRN'] != null) {
		data.lOTRRN = json['LOTRRN'] is String
				? int.tryParse(json['LOTRRN'])
				: json['LOTRRN'].toInt();
	}
	if (json['COMPONENTUNITID'] != null) {
		data.cOMPONENTUNITID = json['COMPONENTUNITID'].toString();
	}
	if (json['EDCSETNAME'] != null) {
		data.eDCSETNAME = json['EDCSETNAME'].toString();
	}
	if (json['EDCSETDESCRIPTION'] != null) {
		data.eDCSETDESCRIPTION = json['EDCSETDESCRIPTION'].toString();
	}
	if (json['EDCTYPE'] != null) {
		data.eDCTYPE = json['EDCTYPE'].toString();
	}
	if (json['EDCSETBINLINELIST'] != null) {
		data.eDCSETBINLINELIST = (json['EDCSETBINLINELIST'] as List).map((v) => EdcDataEDCSETLISTEDCSETBINLINELIST().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> edcDataEDCSETLISTToJson(EdcDataEDCSETLIST entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['EDCCURRENTRRN'] = entity.eDCCURRENTRRN;
	data['LOTRRN'] = entity.lOTRRN;
	data['COMPONENTUNITID'] = entity.cOMPONENTUNITID;
	data['EDCSETNAME'] = entity.eDCSETNAME;
	data['EDCSETDESCRIPTION'] = entity.eDCSETDESCRIPTION;
	data['EDCTYPE'] = entity.eDCTYPE;
	data['EDCSETBINLINELIST'] =  entity.eDCSETBINLINELIST?.map((v) => v.toJson())?.toList();
	return data;
}

edcDataEDCSETLISTEDCSETBINLINELISTFromJson(EdcDataEDCSETLISTEDCSETBINLINELIST data, Map<String, dynamic> json) {
	if (json['NAME'] != null) {
		data.nAME = json['NAME'].toString();
	}
	if (json['DESCRIPTION'] != null) {
		data.dESCRIPTION = json['DESCRIPTION'].toString();
	}
	if (json['SPECTYPE'] != null) {
		data.sPECTYPE = json['SPECTYPE'].toString();
	}
	if (json['USL'] != null) {
		data.uSL = json['USL'].toString();
	}
	if (json['LSL'] != null) {
		data.lSL = json['LSL'].toString();
	}
	if (json['BINTYPE'] != null) {
		data.bINTYPE = json['BINTYPE'].toString();
	}
	if (json['BINACTION'] != null) {
		data.bINACTION = json['BINACTION'].toString();
	}
	if (json['VALUE'] != null) {
		data.VALUE = json['VALUE'].toString();
	}
	if (json['check'] != null) {
		data.check = json['check'].toString();
	}
	return data;
}

Map<String, dynamic> edcDataEDCSETLISTEDCSETBINLINELISTToJson(EdcDataEDCSETLISTEDCSETBINLINELIST entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['NAME'] = entity.nAME;
	data['DESCRIPTION'] = entity.dESCRIPTION;
	data['SPECTYPE'] = entity.sPECTYPE;
	data['USL'] = entity.uSL;
	data['LSL'] = entity.lSL;
	data['BINTYPE'] = entity.bINTYPE;
	data['BINACTION'] = entity.bINACTION;
	data['VALUE'] = entity.VALUE;
	data['check'] = entity.check;
	return data;
}